package com.xnx3.wangmarket.Utils;

import javax.servlet.http.HttpServletRequest;

public class ServerAddressUtils {
    /**
     * 获取服务器ip地址和端口号
     * **/
    public static String serviceAddress(HttpServletRequest request){
        String path = request.getContextPath();
       return request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    }
    /****
     * 获取tomcat绝对路径
     * ***/
    public static String tomcatPath(HttpServletRequest request){

        return request.getRealPath("");
    }
}
